﻿using Smokey.Client.Contexts;
using Smokey.Client.Queries;
using Smokey.Shared.DataTransferObjects;
using System.Collections.Generic;
namespace Smokey.Client.Screens.Applications {
    internal class ApplicationSearchViewModel : ViewModelBase {

        public ApplicationSearchViewModel(ViewModelContext context)
            : base(context) {
        }

        private IList<ApplicationDto> applications = new List<ApplicationDto>();
        public IList<ApplicationDto> Applications {
            get {
                return applications;
            }

            set {
                if (applications != value) {
                    applications = value;
                    OnPropertyChanged("Applications");
                }
            }
        }

        public void LoadApplications() {
            Applications = ApplicationQueries.GetAllApplications();
        }
    }
}
